﻿using UnityEngine;
using System.Collections;

public class SetGameMode : MonoBehaviour {
	public GameObject scroll1;
	public GameObject scroll2;
	public int AI1;
	public int AI2;
	public ModeManager modeMNG;
	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
	
	}
	public void SetMode(){
		if(scroll1.transform.localPosition.x>-600 && scroll1.transform.localPosition.x<-250){
			AI1=0;
		}
		if(scroll1.transform.localPosition.x>-200 && scroll1.transform.localPosition.x<50){
			AI1=1;
		}
		if(scroll1.transform.localPosition.x>200 && scroll1.transform.localPosition.x<400){
			AI1=2;
		}
		if(scroll1.transform.localPosition.x>450){
			AI1=3;
		}
		if(scroll2.transform.localPosition.x>-600 && scroll2.transform.localPosition.x<-250){
			AI2=0;
		}
		if(scroll2.transform.localPosition.x>-200 && scroll2.transform.localPosition.x<50){
			AI2=1;
		}
		if(scroll2.transform.localPosition.x>200 && scroll2.transform.localPosition.x<400){
			AI2=2;
		}
		if(scroll2.transform.localPosition.x>450){
			AI2=3;
		}
		/*0 mean human vs com*/
		if(modeMNG.curMode==Mode.HUMAN_COM){
			GameMode.instance.setMode(0,AI1,AI2);
		}
		else{
			GameMode.instance.setMode(1,AI1,AI2);
		}

		Application.LoadLevel("Main");
	}

}
